#pragma once


#include <vector>
#include <map>
#include <algorithm>

template<typename T>
struct delete_pointer{
	void operator()(T ptr) const{
		delete ptr;
	}
};



template<typename T>
void delete_vector(std::vector<T> & v){
	std::for_each(v.begin(),v.end(),delete_pointer<T>());
	v.clear();
}	


template<typename K,typename T>
void delete_map(std::map<K,T> & v){


	std::map<K,T>::iterator it = v.begin();
	while(it != v.end()){
		delete(it->second);
		it++;
	}
	v.clear();
}